<script setup>
import { useRouter } from 'vue-router'
// 在vue3 CompositionAPI中
// 1. 获取路由对象router useRouter
// const router = useRoute()
// 2. 获取路由参数route useRoute
// const route = useRoute()

const router = useRouter()
// const route = useRoute()

const goList = () => {
  // console.log(router, route)
  router.push('/list')
}
</script>

<template>
  <div>我是app</div>
  <el-button @click="$router.push('/home')">跳首页</el-button>
  <el-button @click="goList">列表页</el-button>
  <router-view></router-view>
</template>
